import java.util.Comparator;
class Money{
    public int moneys = 10;
}

public class Person implements Comparator<Person>,Cloneable{
    public String name;
    public int age;

    public Money money = new Money();
    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }


@Override
 public int compare(Person o1, Person o2) {
    return o1.name.compareTo(o2.name);
}



    @Override
//    protected Object clone(Person this) throws CloneNotSupportedException {
//        return super.clone();
//
//    }
//
    public Person clone()throws CloneNotSupportedException{
        Person tmp = new Person(this.name,this.age);
        tmp.money.moneys = this.money.moneys;
        return tmp;
    }
}
